package com.attilax.rest;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.lang3.reflect.ConstructorUtils;
import org.apache.commons.lang3.reflect.MethodUtils;

import com.attilax.exception.ExUtil;

public class JavaNewCreatorFac {
	
	public static void main(String[] args) {
		//javax.servlet.jsp.PageContext
	}
	
	
	public static <t> t getBean(Class<t> class1) 
	{
		//Class c = Class.forName(class1);
		Object[] p_a =new  	Object[0];
		Object o = null;
		try {
			o = ConstructorUtils.invokeConstructor(class1, p_a);
		} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) {
			ExUtil.throwExV2(e);
		}
		return (t) o;
		
	}

}
